from selenium.webdriver.common.by import By
from page_objects.Shangjia_page import ShangjiaPage

class Search_User_Page(ShangjiaPage):
    # 元素定位器（私有，只在当前页面使用）
    # 1.定位用户名搜索框
    search_product_name_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input')
    # 2.定位查询按钮
    search_product_btn_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[2]/div/div/button')
    # 断言2--暂无数据
    dy2_search_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr/td/div')
    # 断言1--甜豆浆
    dy1_search_loc=(By.XPATH,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr/td[3]/div')
    # 元素的操作方法
    # 1.查询框输入内容
    def search_input_name(self,username):
        self.send_keys(self.search_product_name_loc,username)
        return self
    # 3.点击查询
    def click_search_btn(self):
        self.click(self.search_product_btn_loc)
        return self
